﻿CREATE TABLE [audit].[Unit] (
    [UnitId]                      INT             NOT NULL,
    [UnitCode]                    CHAR (5)        NOT NULL,
    [UnitName]                    VARCHAR (50)    NOT NULL,
    [UnitDescription]             NVARCHAR (1000) NULL,
    [UnitFlashPnLMinThresholdGBP] DECIMAL (18, 2) NULL,
    [UnitFlashPnLMaxThresholdGBP] DECIMAL (18, 2) NULL,
    [UnitFlashManualUpload]       BIT             NULL,
    [UnitFlashMurexUpload]        BIT             NULL,
    [UnitStartDate]               DATE            NOT NULL,
    [UnitEndDate]                 DATE            NULL,
    [IsLatest]                    BIT             NOT NULL,
    [IsActive]                    BIT             NOT NULL,
    [IsInternal]                  BIT             NOT NULL,
    [BookReference]               VARCHAR (8)     NULL,
    [BookReferenceType]           VARCHAR (8)     NULL,
    [BookTrader]                  VARCHAR (100)   NULL,
    [BookPnLPackageId]            INT             NULL,
    [BookDoubleEntryBookCode]     CHAR (3)        NULL,
    [BookAdjustFutures]           TINYINT         NULL,
    [DeskGlobalAccountCode]       CHAR (8)        NULL,
    [ProjectClassificationId]     SMALLINT        NULL,
    [ProjectTreatmentId]          SMALLINT        NULL,
    [ProjectSystemId]             SMALLINT        NULL,
    [AuditId]                     INT             NOT NULL,
    [AuditType]                   CHAR (1)        NOT NULL,
    [IsAuditRowNew]               BIT             NOT NULL
);

